package com.aracky.system.controller;

import com.aracky.common.vo.CommonResult;
import com.aracky.system.model.vo.SysDictVO;
import com.aracky.system.service.SysDictTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 字典数据表 前端控制器
 * </p>
 *
 * @author zengzhiping
 * @since 2022-07-15 09:11:40
 */
@RestController
@RequestMapping("/DictData")
@Api(tags = "字典外部调用接口")
public class DictDataController {

    @Autowired
    private SysDictTypeService sysDictTypeService;


    @PostMapping("/mapList")
    @ApiOperation(value = "通过字典编码查询字典数据")
    @ApiImplicitParam(name = "dictCodeList",value = "字典编码数组")
    public CommonResult<Map<String, List<SysDictVO>>> getMapList(@RequestParam(required = false) List<String> dictCodeList) {
        Map<String, List<SysDictVO>> resultMap = sysDictTypeService.getMapList(dictCodeList);
        return CommonResult.success(resultMap);
    }

}
